import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:yt_devops/components/app_bar/app_bar_widget.dart';
import 'package:yt_devops/components/gaps.dart';
import 'package:yt_devops/components/yt_text_style.dart';
import 'package:yt_devops/resources/str_res_keys.dart';
import 'package:yt_devops/styles/styles.dart';
import 'no_permission_controller.dart';

class NoPermissionPage extends GetView<NoPermissionController> {
  final bool backLogin = false;

  const NoPermissionPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBarWidget.defaultAppBar(ResKey.noAccessPermission.tr),
      body: Column(
        children: [
          Container(
            margin: EdgeInsets.only(
              top: 190.h,
              left: (ScreenUtil().screenWidth - 160.w) * 0.5,
              right: (ScreenUtil().screenWidth - 160.w) * 0.5,
            ),
            child: Image.asset(
              'assets/images/no_permission.png',
              height: 160.w,
              width: 160.w,
            ),
          ),
          Container(
            alignment: Alignment.center,
            margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24),
            child: Text(
              ResKey.noAccessPermission.tr,
              style: ytTextStyle(color: Colour.mainTextColor, fontSize: 16),
            ),
          ),
          Gaps.vGap20,
          Container(
            height: 44,
            width: 125.w,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(4),
              color: Colour.primaryColor,
            ),
            alignment: Alignment.center,
            margin: EdgeInsets.only(left: 16.w, right: 16.w),
            child: GestureDetector(
              onTap: () {
                controller.goBack();
              },
              child: Text(
                ResKey.back.tr,
                style: ytTextStyle(color: Colors.white, fontSize: 16),
              ),
            ),
          ),
          const Spacer(),
        ],
      ),
    );
  }
}
